<!doctype html>
<html>

<head>
    <meta charset="UTF-8">
    <title>TOP崩溃</title>
    <link href="css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="css/freeue.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
	<link href="css/table.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" type="text/css" media="all" href="css/daterangepicker.css" />
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>
    <!--顶部菜单栏嵌入-->
	<?php require_once("./header.php"); 
		header('Content-type: text/html; charset=UTF8');
		$yesterday = date('Y-m-d', time()-1*24*60*60);
	?>
	<!--左侧菜单栏-->
	<?php require_once("./mala-0204-left.php"); ?>
    <!--===========主内容区=========-->
    <section class="mala-content">
        <h1 class="mala-title-bar mala-title-bar-solo">TOP崩溃</h1>
        <div class="mala-container-fluid">
			<div class="mala-search-bar">
				<span>日期：</span><input type="date" id="select_date" name="select_date" class="mala-input mala-input-large mala-mr" min="2015-01-01" max="<?php echo $yesterday; ?>" value="<?php echo $yesterday; ?>" />
				<input type="button" id="total_fs_btn" name="total_fs_btn" class="mala-btn mala-btn-default mala-btn-small " value="刷新" onclick="updata_click()" />
            </div>
			<div id="container">
           
			</div>
        </div>
    </section>
    <div class="mala-aside-opt">
        <a href="#" class="" id="mala-aside-hide">
            <i class="fa fa-arrow-left"></i>
        </a>
        <a href="#" class="" id="mala-aside-show" style="display:none">
            <i class="fa fa-arrow-right"></i>
        </a>
    </div>
    <script src="js/jquery-1.11.0.min.js"></script>
    <!-- 主要用户左侧栏的下拉效果和导航栏的下拉 -->
    <script src="js/common.js"></script>
    <script src="js/echarts-plain-map.js"></script>
    <!-- bootstrap的modal.js，控制弹窗 -->
    <script>
    var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
    document.write(unescape("%3Cdiv style='display:none;' %3E %3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fa04bc642fb15cb6b591f8fe5423f1bc2' type='text/javascript'%3E%3C/script%3E"));
	
	$(document).ready(function(){
		$.ajax({
			type: "get",
			async: false,
			url: "http://10.212.183.60/crashdir/html/index/get_topcrash_data.php", 
			data: {"type": "1"},
			success: function(data) {
				var container = $("#container");
				container.text("");// 清空数据
                container.append(data);
			},
			error: function(XMLHttpRequest, textStatus, errorThrown) {
				alert("error!");
				alert(XMLHttpRequest.status);
				alert(XMLHttpRequest.readyState);
				alert(textStatus);
			}
		});
	});
	function updata_click(){
		var enday  = $("#select_date").val();
		var stday  = new Date(enday+" 23:59:59");
		var parameter = "";
		if (stday > new Date()){
			alert("日期最迟为昨天，请重新选择");
			return;
		}
		parameter = parameter+"type=2&enday="+enday;;
		//调用ajax根据选项值局部更新数据
		$.ajax({
			type: "get",
			async: false,
			url: "http://10.212.183.60/crashdir/html/index/get_topcrash_data.php", 
			data: parameter,
			success: function(data) {
				var container = $("#container");
				container.text("");// 清空数据
                container.append(data);
			},
			error: function(XMLHttpRequest, textStatus, errorThrown) {
				alert("error!");
				alert(XMLHttpRequest.status);
				alert(XMLHttpRequest.readyState);
				alert(textStatus);
			}
		});
	}
	
    </script>
    
    <style type="text/css">      
    .demo { position: relative; }      
    .demo i {
         position: absolute; bottom: 10px; right: 24px; top: auto; cursor: pointer;
    }
    </style>

    <script type="text/javascript" src="js/bootstrap.min.js"></script>
    <script type="text/javascript" src="js/moment.js"></script>   
</body>

</html>
